<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of BestSelling
 *
 * @author HUYNHY
 */
class BestSelling
{
    public function getlistBestSelling($db)
    {
	$row = array();
	if ($db != null)
	{
	    $db = new Database();
		$sqlQuery = "SELECT DISTINCT I.I_ID, I.I_Alias, I.I_Title, I.I_Price,I.I_Image
    FROM items AS I INNER JOIN order_detail AS od ON I.I_ID = od.OD_I_ID 
    WHERE od.OD_Quantity > 5 limit 10;";
	    $rs = $db->executeQuery($sqlQuery, null, null, null);
	    
	    if ( $rs != null)
	    {
		while ($rows = $rs->fetch())
		{
		    $row[] = $rows;
		}
	    }
	    return $row;
	}
    }
}

?>
